import tygger
from pyglet import sprite


class PygletPhysicsStaticCollisionBody(sprite.Sprite, tygger.PhysicsStaticCollisionBody):
	def __init__(self, *args, **kargs):
		sprite.Sprite.__init__(self, *args, **kargs)
		args = []
		kargs = {}
		print self.x, self.y
		kargs['x'] = self.x
		kargs['y'] = self.y
		kargs['w'] = self.width
		kargs['h'] = self.height
		tygger.PhysicsStaticCollisionBody.__init__(self, *args, **kargs)
	


class PygletPhysicsCollisionBody(sprite.Sprite, tygger.PhysicsCollisionBody):
	def __init__(self, *args, **kargs):
		sprite.Sprite.__init__(self, *args, **kargs)
		#self.x = kargs['x']
		#self.y = kargs['y']
		args = []
		kargs = {}
		kargs['x'] = self.x
		kargs['y'] = self.y
		kargs['w'] = self.width
		kargs['h'] = self.height
		tygger.PhysicsCollisionBody.__init__(self, *args, **kargs)
	
	def physics_sync(self):
		self.x, self.y, self.rotation = self.get_location()
	

